//
//  BrokenAnimation.m
//  LearnObjectiveC
//
//  Created by 吴可高 on 16/6/6.
//  Copyright © 2016年 吴可高. All rights reserved.
//

#import "BrokenAnimation.h"

@implementation BrokenAnimation
+(BrokenAnimation*)addAnimationKeyPath:(NSString*)keyPath
                              fromValue:(NSValue*)fromValue
                                toValue:(NSValue*)toValue
                               duration:(NSTimeInterval)timeInterval;
{
    CABasicAnimation * baseAnimation  = [CABasicAnimation animationWithKeyPath:keyPath];
    baseAnimation.fromValue = fromValue;
    baseAnimation.toValue  = toValue;
    baseAnimation.duration = timeInterval;
    baseAnimation.autoreverses = YES;
    baseAnimation.fillMode =  kCAFillModeBackwards;
    return baseAnimation;
}
@end
